﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PloobsEngine.Material;
using PloobsEngine.Cameras;

namespace PloobsEngine.SceneControl
{
    public class DummyCuller : ICuller
    {
        
        #region ICuller Members
        int num;
        List<IObject> deferred = new List<IObject>();
        List<IObject> forward = new List<IObject>();

        public void StartFrame(IWorld world,ICamera cam)
        {
            deferred.Clear();
            forward.Clear();
            foreach (var item in world.Objects)
            {
                if (item.Material.MaterialType == MaterialType.DEFERRED)
                    deferred.Add(item);
                else                
                    forward.Add(item);
            }
            num = world.Objects.Count;
        }

        public IEnumerable<IObject> GetNotCulledObjectsList(IWorld world, ICamera cam, MaterialType Filter)
        {
            if (Filter == MaterialType.DEFERRED)
                return deferred;
            else
                return forward;
        }   


        #endregion

        #region ICuller Members


        public void onObjectAdded(IObject obj)
        {            
        }

        public void onObjectRemoved(IObject obj)
        {         
        }

        #endregion

        #region ICuller Members


        public int RenderedObjectThisFrame
        {
            get { return num; }
        }

        #endregion
    }
}
